import { uniFileUpload, request } from '@/utils/request';

export function selectPetitionById(id?: Object) {
  return request({
    url: `/pm/itemPetition/selectPetitionById/${id}`,
    method: 'GET',
  });
}

export function updateSignHandle(obj?: Object) {
  return request({
    url: '/pm/rdProjectUser/updateSignPetition',
    method: 'PUT',
    data: obj,
  });
}

export function updateByIdOpinion(obj?: Object) {
  return request({
    url: '/pm/itemPetition/updateItemPetitionOpinion',
    method: 'PUT',
    data: obj,
  });
}

export const completeTask = (obj?: Object, id?: string) => {
  return request<{ data: any }>({
    url: '/pm/itemPetition/complete?id=' + id,
    method: 'POST',
    data: obj,
  });
};

export function revokeProcess(query?: Object) {
  return request({
    url: '/pm/itemPetition/revoke',
    method: 'GET',
    query: query,
  });
}

export function reviveProcess(id?: string) {
  return request({
    url: '/pm/itemPetition/reviveProcess/' + id,
    method: 'GET',
  });
}
